#import <Foundation/Foundation.h>
#import "NSString+Extension.h"
#import "UIView+Extension.h"
#import "UIBarButtonItem+Extension.h"

#ifdef DEBUG
#define KRLog(...) NSLog(__VA_ARGS__)
#else
#define KRLog(...)
#endif

#define KRColorWithAlpha(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define KRColor(r, g, b) KRColorWithAlpha(r, g, b, 1.0)
#define KRColorRGB(rgb) KRColor(rgb, rgb, rgb)
#define KRColorRGBWithAlpha(rgb, a) KRColor(rgb, rgb, rgb, a)
#define KRRandomColor KRColor(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))

#define KRScreenWidth [UIScreen mainScreen].bounds.size.width
#define KRScreenHeight [UIScreen mainScreen].bounds.size.height
#define KRLayoutWidth KRScreenWidth
#define KRColumnViewWidth KRScreenWidth
#define KRAlbumWidth KRScreenWidth
#define KRAlbumListWidth KRScreenWidth
#define KRReadListWidth KRScreenWidth

#define KRStatusBarHeight [UIApplication sharedApplication].statusBarFrame.size.height
#define KRNavBarHeight self.navigationController.navigationBar.frame.size.height
#define KRTopBarHeight (KRStatusBarHeight + KRNavBarHeight)

#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)
#define iOS8 ([[UIDevice currentDevice].systemVersion doubleValue] >= 8.0)
#define iOS9 ([[UIDevice currentDevice].systemVersion doubleValue] >= 9.0)


/** cell的行高 */
extern NSUInteger const baseCellHeight;
/** cell的内边距 */
extern NSInteger const cellPadding;

extern NSString * const KRWebviewDidGetHeightNotification;
extern NSString * const KRWebviewHeight;